package net.ikenna.yadet;

import net.ikenna.yadet.core.DataManipulator;
import org.apache.log4j.Logger;

public class Runner {
    private static Container container = new Container();
    private static Logger logger = Logger.getLogger(Runner.class);

    public static void main(String[] args) {
        Runner.run();
    }

    public static void run() {
        logger.info("[Data extraction started]");
        try {
            DataManipulator dataManipulator = (DataManipulator) container.get(DataManipulator.class);
            dataManipulator.run();
        } catch (Exception e) {
            logger.warn("[Error running data manipulator]", e);
        }
        logger.info("[Data extraction ended]");
    }

    public static void setContainer(Container container) {
        Runner.container = container;
    }
}
